package erp.education.web.action.setup.school;

import org.springframework.beans.factory.annotation.Autowired;

import com.opensymphony.xwork2.ModelDriven;

import erp.education.client.setup.school.BranchToCourseRequest;
import erp.education.server.beans.interfaces.setup.school.BranchToCourseServiceI;
import erp.education.web.common.BaseAction;

public class BranchToCourseAction extends BaseAction implements
		ModelDriven<BranchToCourseRequest> {
	@Autowired
	BranchToCourseRequest branchtoCourseRequest;
	@Autowired
	BranchToCourseServiceI branchsToCourseService;

	public String branchsToCouserLoad() throws Exception {

		this.result = branchsToCourseService.branchsToCourseLoadSevice(
				branchtoCourseRequest).getResponseObject();
		getRequest().setAttribute("result", this.result.getResultList());

		return "branchtocourse";
	}

	public String saveUpdateBranchDetails() throws Exception {
		this.result = branchsToCourseService.saveUpdateBranchToCourseDetails(
				branchtoCourseRequest).getResponseObject();

		return "branchtocourse";
	}

	@Override
	public BranchToCourseRequest getModel() {
		return this.branchtoCourseRequest;
	}
}
